</trkpt>
<trkpt lat="47.547749767" lon="9.679499575">
<ele>435.413042</ele>
- <time>2019-03-30T23:59:44Z</time>
+ <time>2019-03-30T23:59:42Z</time>
<speed>2.777778</speed>
<name>TP0039</name>
</trkpt>
<trkpt lat="47.547749767" lon="9.679499575">
<ele>435.413042</ele>
- <time>2019-04-01T23:59:44Z</time>
+ <time>2019-04-01T23:59:42Z</time>
<speed>27.777779</speed>
<name>TP0040</name>
</trkpt>
<trkpt lat="47.547749767" lon="9.679499575">
<ele>435.413042</ele>
- <time>2019-04-06T01:37:52Z</time>
+ <time>2019-04-06T01:37:50Z</time>
<speed>27.777779</speed>
<name>TP0041</name>
</trkpt>
<trkpt lat="47.547749767" lon="9.679499575">
<ele>435.413042</ele>
- <time>2019-04-06T23:59:42Z</time>
+ <time>2019-04-06T23:59:40Z</time>
<speed>55.555557</speed>
<name>TP0042</name>
</trkpt>
<trkpt lat="47.547749767" lon="9.679499575">
<ele>435.413042</ele>
- <time>2019-04-06T23:59:43Z</time>
+ <time>2019-04-06T23:59:41Z</time>
<speed>55.555557</speed>
<name>TP0043</name>
</trkpt>
static char* opt_no_output = 0; /* disable output? (0/1) */
static char* opt_set_location = 0; /* set if the "targetlocation" options was used */
static char* opt_configure_logging = 0;
+static char* opt_gps_utc_offset = 0;
static
arglist_t skytraq_args[] = {
"no-output", &opt_no_output, "Disable output (useful with erase)",
"0", ARGTYPE_BOOL, ARG_NOMINMAX
},
+ {
+ "gps_utc_offset", &opt_gps_utc_offset, "Seconds that GPS time tracks UTC (0: best guess)",
+ "0", ARGTYPE_INT, ARG_NOMINMAX
+ },
ARG_TERMINATOR
};
"last-sector", &opt_last_sector, "Last sector to be read from the file (-1: read till empty sector)",
"-1", ARGTYPE_INT, "-1", "65535"
},
+ {
+ "gps_utc_offset", &opt_gps_utc_offset, "Seconds that GPS time tracks UTC (0: best guess)",
+ "0", ARGTYPE_INT, ARG_NOMINMAX
+ },
ARG_TERMINATOR
};
time_t gps_timet = 315964800; /* Jan 06 1980 0:00 UTC */
gps_timet += (week+1024)*7*SECONDS_PER_DAY + sec;
+ int override = atoi(opt_gps_utc_offset);
+ if (override) {
+ gps_timet -= override;
+ return gps_timet;
+ }
+
/* leap second compensation: */
gps_timet -= 13; /* diff GPS-UTC=13s (valid from Jan 01 1999 on) */
if (gps_timet >= 1136073600) { /* Jan 01 2006 0:00 UTC */
if (gps_timet >= 1341100800) { /* Jul 01 2012 0:00 UTC */
gps_timet--; /* GPS-UTC = 16s */
}
+ if (gps_timet >= 1435708800) { /* Jul 01 2015 0:00 UTC */
+ gps_timet--; /* GPS-UTC = 17s */
+ }
+ if (gps_timet >= 1483228800) { /* Jan 01 2017 0:00 UTC */
+ gps_timet--; /* GPS-UTC = 18s */
+ }
+ // Future: Consult http://maia.usno.navy.mil/ser7/tai-utc.dat
+ // use http://www.stevegs.com/utils/jd_calc/ for Julian to UNIX sec
return gps_timet; /* returns UTC time */
}
--- /dev/null
+<para>
+gps_utc_offset is used to override the built-in table of offsets of
+the offset between GPS time and UTC time. This chipset reports only
+GPS time to the host and relies on software to know every time an adjustment
+is made. Since GPS time offsets can change without a new version of GPSBabel
+is released, those that care about total accuracy can override it.
+
+<screen>
+<command>gpsbabel</command>
+-i skytraq.bin,gps_utc_offset=15 -f <replaceable>filename.bin</replaceable>
+</screen>
+
+Indicates that GPS is ahead of UTC by fifteen seconds, as was the case in 2009.
+</para>
+
+<para>
+Consult formal eplanation of <ulink url="http://tycho.usno.navy.mil/leapsec.html">GPS time vs. UTC time</ulink> if you're into that.
+</para>